#include <bits/stdc++.h>
using namespace std;
int n;
int a[100005];
int b[100005];
int s;
int k;
int main()
{
    freopen("duel.in", "r", stdin);
    freopen("duel.out", "w", stdout);
    scanf("%d", &n);
    for (int i = 1;i <= n;i++)
        scanf("%d", a + i);
    sort(a + 1, a + n + 1);
    k = 1;
    b[1] = 1;
    for (int i = 2;i <= n;i++)
    {
        if (a[i] != a[i - 1])
        {
            k++;
            b[k]++;
        }
        else
            b[k]++;
    }
    /*for (int i = 2;i <= n;i++)
    {
        if (a[i] > a[i - 1])
            s++;
    }*/
    s = b[1];
    for (int i = 2;i <= k;i++)
    {
        if (s >= b[i])
            s -= b[i];
        else
            s = 0;
        s += b[i];
    }
    printf("%d", s);
    return 0;
}